<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Parent(){
            this.name = '曹操'
        }

        Parent.prototype.getName = function(){
            return this.name
        }

        function Child(){

        }

        Child.prototype = new Parent()

        const child1 = new Child

        console.log(child1.name)
        console.log(child1.getName())

        const child2 = new Child()
        child1.name[0] = '孙权'
        console.log(child2.name)

        //
     </script>
</body>
</html>